using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class HospitalCatheterizationCardMap : EntityTypeConfiguration<HospitalCatheterizationCard>
    {
        public HospitalCatheterizationCardMap()
        {
            // Primary Key
            this.HasKey(t => new { t.HCC_ID, t.follow_up_id });

            // Properties
            this.Property(t => t.HCC_ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.HCC_Departments)
                .HasMaxLength(50);

            this.Property(t => t.HCC_Sickroom)
                .HasMaxLength(50);

            this.Property(t => t.HCC_Bed)
                .HasMaxLength(50);

            this.Property(t => t.HCC_catheter)
                .HasMaxLength(50);

            this.Property(t => t.HCC_Diagnosis)
                .HasMaxLength(50);

            this.Property(t => t.HCC_Emergency)
                .HasMaxLength(50);

            this.Property(t => t.HCC_DateTime)
                .HasMaxLength(50);

            this.Property(t => t.preview_wrapper)
                .HasMaxLength(100);

            this.Property(t => t.size_fake)
                .HasMaxLength(100);

            this.Property(t => t.Operating)
                .HasMaxLength(50);

            this.Property(t => t.Pathway)
                .HasMaxLength(50);

            this.Property(t => t.HCC_ltNo)
                .HasMaxLength(20);

            this.Property(t => t.follow_up_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.CR_txt151)
                .HasMaxLength(50);

            this.Property(t => t.CR_slISCG)
                .HasMaxLength(50);

            this.Property(t => t.Remarks)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("HospitalCatheterizationCard");
            this.Property(t => t.HCC_ID).HasColumnName("HCC_ID");
            this.Property(t => t.HCC_Departments).HasColumnName("HCC_Departments");
            this.Property(t => t.HCC_Sickroom).HasColumnName("HCC_Sickroom");
            this.Property(t => t.HCC_Bed).HasColumnName("HCC_Bed");
            this.Property(t => t.HCC_catheter).HasColumnName("HCC_catheter");
            this.Property(t => t.HCC_Diagnosis).HasColumnName("HCC_Diagnosis");
            this.Property(t => t.HCC_Emergency).HasColumnName("HCC_Emergency");
            this.Property(t => t.HCC_DateTime).HasColumnName("HCC_DateTime");
            this.Property(t => t.preview_wrapper).HasColumnName("preview_wrapper");
            this.Property(t => t.size_fake).HasColumnName("size_fake");
            this.Property(t => t.Operating).HasColumnName("Operating");
            this.Property(t => t.Pathway).HasColumnName("Pathway");
            this.Property(t => t.HCC_ltNo).HasColumnName("HCC_ltNo");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.CR_txt151).HasColumnName("CR_txt151");
            this.Property(t => t.CR_slISCG).HasColumnName("CR_slISCG");
            this.Property(t => t.Remarks).HasColumnName("Remarks");
        }
    }
}
